<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    function strConvert(str){
        let str1=str.split('');
        for(let i=0;i<str1.length;i++){
           if(str1[i].charCodeAt()>=65&&str1[i].charCodeAt()<=90){
            str1[i]=str1[i].toLowerCase();
           }else{
            str1[i]=str1[i].toUpperCase();
           }
        }
        return str1.join('');
    }
    console.log(strConvert('HelloWorld'));
</script>